package com.wmm.fast.order.controller.client;

import com.wmm.fast.order.model.TccRequest;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author erdan
 * @date 2018/9/15
 * @email wangzun@2moon.org
 */
@FeignClient(name = TccClient.SERVICE_ID,fallback = TccClientFallBack.class)
public interface TccClient {
    String SERVICE_ID = "tcc-service";

    String API_PATH = "/api/v1";

    @RequestMapping(value = API_PATH + "/confirmation",method = RequestMethod.PUT,produces = {MediaType.APPLICATION_JSON_UTF8_VALUE},consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
    void confirm(@RequestBody TccRequest request);
}
